try:
    # Set matplotlib backend once here
    import matplotlib

    matplotlib.use("Agg")
except:
    pass
